/**
 * polluteEvent vuex
 */
import posts from '@/plugins/request'

// initial state
const state = {
  polluteEventList: {
    total: 0,
    rows: []
  }
}
// getters
const getters = {
  getPolluteEventList: state => state.polluteEventList
}
// actions
const actions = {
  async postPolluteEvent({commit}, formData) {
    let res = await posts.postPolluteEventUpload(formData)
    return res
  },
  async getPolluteEventList({commit}, param) {
    let data = await posts.postPolluteEventList(param)
    commit('changePolluteEventList', data)
  },
}

// mutations
const mutations = {
  changePolluteEventList(state, data) {
    state.polluteEventList = data
  }
}
export default {
  state,
  getters,
  actions,
  mutations
}
